<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="java.sql.*"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
 	"http://struts.apache.org/dtds/struts-2.1.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<link href="css/css.css" rel="stylesheet" type="text/css">
<script language="javascript">
	function updatecheck() {
		mdiv = document.getElementById("form1");
		if (form1.uname.value == "") {
			// alert("用户名不能为空");
			alert("用户名不能为空！");
			form1.uname.focus();
			return ;
		}
		if (form1.password.value == "") {
			alert("密码不能为空！");
			form1.password.focus();
			return ;
		}
		if (form1.newpwd.value == "") {
			// alert("用户名不能为空");
			alert("新密码不能为空！");
			form1.newpwd.focus();
			return ;
		}
		if (form1.realname.value == "") {
			// alert("用户名不能为空");
			alert("姓名不能为空！");
			form1.realname.focus();
			return ;
		}
		if (form1.phone.value == "") {
			// alert("用户名不能为空");
			alert("电话不能为空！");
			form1.phone.focus();
			return ;
		}
		
		document.form1.action="updateUserAction.action" ;
    	document.form1.submit() ;
	}
	
</script>
<body>
	<s:form id="form1" name="form1" method="post">
		<table width="100%" height="100%" border="0" bgcolor="#ecf9dc"
			align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
			<tr>
				<td align="center"><img src="images/fg1.jpg" width="752"
					height="39"><br>
				<br>
				<br>
				<br>
					<table width="280" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="180"><br> <s:textfield label="新用户名"
									value="%{#session.user.uname}" property="uname" name="uname"></s:textfield>
							</td>
						</tr>
						<tr>
							<td><br> <s:password label="密码" property="password"
									name="password"></s:password>
							</td>
						</tr>
						<tr>
							<td><br> <s:password label="新密码" name="newpwd"
									property="newpwd"></s:password>
							</td>
						</tr>
						<tr>
							<td><br> <s:textfield label="真实姓名"
									value="%{#session.user.realname}" name="realname"
									property="realname"></s:textfield></td>
						</tr>
						<tr>
							<td><br> <s:textfield label="电话" name="phone"
									value="%{#session.user.phone}" property="phone"></s:textfield>
							</td>
						</tr>

					</table> <br> <br> <br> <a href="#"
					onClick="javascript:updatecheck()"><img src="images/save.jpg">
				</a> &nbsp;&nbsp; <a href="#" onClick="javascript:form1.reset()"><img
						src="images/clear.gif"> </a> &nbsp;&nbsp; <a href="#"
					onClick="javasrcipt:history.go(-1)"><img src="images/back.gif">
				</a> <br> <br> <br>
					<p>&nbsp;</p></td>
			</tr>
		</table>
	</s:form>
</body>
</html>
